<template>
    <div class="paper-manager-root">
        <paper-tree @vocal="getData"></paper-tree>
        <paper-class-add ref="paperClass">
        
        </paper-class-add>
    </div>
</template>

<script>
import paperClassAdd from "@c/paperClassSearch";
import PaperTree from "@c/paperTree";
import { getData, Utils } from "@/utils/Util";

export default {
    name: "paperClassManager",
    components: { PaperTree, paperClassAdd },
    methods: {
        // 点击分类后重新获取数据
        getData(obj) {
            this.$refs.paperClass.field_class = obj.label;
            this.$refs.paperClass.getData(1);
        }
    },
    created() {
        getData("/paper/fields", {
            paperClass: "paper_class",
            paperGrade: "paper_grade",
            difficulty: "difficulty",
            status: "status",
            createMan: "create_man"
        }).then(res => {
            // console.log(res);
            sessionStorage.setItem("paperGroupField", JSON.stringify(res));
        });
    }
};
</script>

<style scoped lang="scss">
    .paper-manager-root {
        display: flex;
    }
</style>